package com.qch.rabbitmq.demo;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.core.MessageBuilder;
import org.springframework.amqp.core.MessageProperties;
import org.springframework.amqp.core.MessagePropertiesBuilder;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author qch
 * @Date 2021/5/14
 */
public class ConsumerApp {
    public static void main(String[] args) throws Exception {
        new ClassPathXmlApplicationContext("spring-rabbit.xml");
       /* RabbitTemplate template = applicationContext.getBean(RabbitTemplate.class);
        //拉消息模式
        Message receiveMessage = template.receive("queue.q1");
        System.out.println(new String(receiveMessage.getBody(),receiveMessage.getMessageProperties().getContentEncoding()));
        applicationContext.close();*/
    }
}
